--死境硝烟
local sijingxiaoyan = fk.CreateSkill {
    name = "mcdh_sijingxiaoyan"
}

local U = require "packages/utility/utility"
local lib = require "packages/mcdh/lib"

sijingxiaoyan:addEffect('active',{
    can_use = function(self, player)
        return player:usedSkillTimes(self.name, Player.HistoryPhase) == 0
    end,
    target_num = 1,
    card_filter = Util.FalseFunc,
    target_filter = function (self, to_select, selected)
        if #selected == 0 then
            local target = Fk:currentRoom():getPlayerById(to_select)
            if target then
                local num = #target:getCardIds(Player.Hand)
                return not target:hasSkill("mcdh_jifengershi") and num >= 2 and num <= 3
            end
        end
    end,
    on_use = function (self, room, use)
        local player = room:getPlayerById(use.from)
        local target = room:getPlayerById(use.tos[1])
        local num = #target:getCardIds(Player.Hand) - 1
        local cids = room:askForCardsChosen(player, target, num, num, "h", self.name,"#mcdh_jifengershi_discard:::"..num)
        room:throwCard(cids, self.name, target, player)
        room:handleAddLoseSkills(target,"mcdh_jifengershi")
    end
})

Fk:loadTranslationTable{
    ["mcdh_sijingxiaoyan"] = "死境",
    [":mcdh_sijingxiaoyan"] = "『死境硝烟』<br>出牌阶段限一次，你可以选择一名手牌数为2至3的没有〖锋试〗的角色，弃置其手牌至一张，令其获得技能〖锋试〗。",
    ["#mcdh_jifengershi_trigger"] = "锋试",
    ["#mcdh_jifengershi_discard"] = "死境硝烟：弃置 %arg 张牌",
}

return sijingxiaoyan